import React from 'react'
import {
    useNavigate
} from "react-router-dom"

export default function Home() {
    const navigate = useNavigate();

  return (
    <div>
        <h3>首页</h3>
        <button onClick={()=>{
            navigate({                    
                pathname:"/one",
                search:"a=999&b=99999"
            })
        }}>one2</button>
        <button onClick={()=>{
            navigate({
                pathname:'/two',
            }, {
                state:{
                    a:1,
                    b:2,
                    c:{
                        username: '张三'
                    }
                }
            })
        }}>two</button>
    </div>
  )
}
